<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<center>
		<form action="{url:/test/emails}" method="post">
			用户名：<input type="text" name="names" id="names"><br>
			密码：<input type="password" name="pwd" id="pwd"><br>
			电子邮箱：<input type="text" name="email" id="email"><br>
			<input type="button" value="注册" id="send">
		</form>
	</center>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	$("#send").click(function(){
		var names = $("#names").val();
		var pwd = $("#pwd").val();
		var email = $("#email").val();
		if (names == ''||pwd==''||email=='')
		{
			alert("用户名密码电子邮箱不能为空");
			return false;
		};
		// alert(names);
		var tests = /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/;
 		if(!tests.test(email))
 		{
 			alert("电子邮箱格式不正确");
 			return false;
 		}
 		$("form").submit();
	})

</script>